import service from '@/utils/request'

export const getCaptcha = () => {
  return service.get('/sys/oauth/captcha')
}

export const login = (data) => {
  return service.post('/sys/oauth/token', data, {
    auth: {
      username: 'chat',
      password: '123456',
    },
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  })
}

export const logout = () => {
  return service.post('/sys/oauth/logout')
}
